#include "user_service.h"
#include <stdio.h>
#include <string.h>
#include "user_dao.h"

int
service_login_check(const char *name, const char *password)
{
    if (name == NULL || password == NULL || strlen(name) == 0 || strlen(password) == 0)
    {
        return (-1);
    }
    return (dao_login_check(name, password));
}

int
service_check_user_is_exists(const char *name)
{
    if (name == NULL || strlen(name) == 0)
    {
        return (-1);
    }
    return (dao_check_user_is_exists(name));
}

int
service_add_user(struct user *u)
{
    return (dao_add_user(u));
}